<?php

/**
 * @copyright 2011
 * @version $Id$
 * @access public
 * @author Oriotiori

 */

class Admin_Model_Facade_Taxes{

	/**
	 * @param array $to: Array de datos a guardar.
	 * @return int $lastid
	 */
	public function addTaxes($to)
	{
		$TBD_Resource = new Admin_Model_Taxes();
		try{
			$data = $TBD_Resource->addTaxes($to);
			return $data;
		}catch(Exception $e)
		{
			$error=array($e->getFile(), 'Exception: '.$e->getMessage());
			$ExceptionHandler= new Default_Model_ExceptionHandler();
			$ExceptionHandler->saveErrors($error);
		}
		return false;
	}

	/**
	 * @param array $to: Array de datos a guardar.
	 * @return boolean
	 */
	public function updateTaxesById($to)
	{
		$TBD_Resource = new Admin_Model_Taxes();
		try{
			$data = $TBD_Resource->updateTaxesById($to);
			return $data;
		}catch(Exception $e)
		{
			$error=array($e->getFile(), 'Exception: '.$e->getMessage());
			$ExceptionHandler= new Default_Model_ExceptionHandler();
			$ExceptionHandler->saveErrors($error);
		}
		return false;
	}




	/**
	 * @return array $data
	 */
	public function getTaxes()
	{
		$TBD_Resource = new Admin_Model_Taxes();
		try{
			$data = $TBD_Resource->getTaxes();
			return $data;
		}catch(Exception $e)
		{
			$error=array($e->getFile(), 'Exception: '.$e->getMessage());
			$ExceptionHandler= new Default_Model_ExceptionHandler();
			$ExceptionHandler->saveErrors($error);
		}
		return false;
	}

	/**
	 * @param int $id
	 * @return array $data
	 */
	public function getTaxesById($id=0)
	{
		$TBD_Resource = new Admin_Model_Taxes();
		try{
			$data = $TBD_Resource->getTaxesById($id);
			return $data;
		}catch(Exception $e)
		{
			$error=array($e->getFile(), 'Exception: '.$e->getMessage());
			$ExceptionHandler= new Default_Model_ExceptionHandler();
			$ExceptionHandler->saveErrors($error);
		}
		return false;
	}

	
	/**
	 * @param int $id
	 * @return boolean
	 */
	public function deleteTaxesById($id=0)
	{
		$TBD_Resource = new Admin_Model_Taxes();
		try{
			$data = $TBD_Resource->deleteTaxesById($id);
			return $data;
		}catch(Exception $e)
		{
			$error=array($e->getFile(), 'Exception: '.$e->getMessage());
			$ExceptionHandler= new Default_Model_ExceptionHandler();
			$ExceptionHandler->saveErrors($error);
		}
		return false;
	}


}
